/*=+--+=#=+--     Unmanned Aerial System Management Software      --+=#=+--+=#*\
|          Copyright (C) 2011 Regents of the University of Colorado.           |
|                             All Rights Reserved.                             |

     This program is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License version 2 as
     published by the Free Software Foundation.

     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.

     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.

            Jack Elston                       Cory Dixon                        
|           elstonj@colorado.edu              dixonc@colorado.edu              |
|                                                                              |
\*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*/

/*!
  \file XMLtoData.h
	\brief header file for XML generator

                    \author Jack Elston
             $Date: 2006/10/25 13:34:45 $
*/

#ifndef __MNRSIM_H
#define __MNRSIM_H

#include "String.h"
#include "command.h"
#include "queue.h"
#include "type_defs.h"
#include "threadedPipe.h"
#include "shmStruct.h"

/*<-------Defines--------->*/
/*! \brief seconds between capabilites transmission. */
#define TELEMETRY_PERIOD 1
#define NUM_WAYPOINTS 10 
/*<------End Defines------>*/

typedef struct{
	float x;
	float y;
} Velocity_t;

/************************************************************\
|                    DatatoXML_Parser                        |
\************************************************************/
/*!
  \class DatatoXML_Parser
  \brief reads command data from a fifo, converts it to XML
  and places it into an outgoing fifo

  The DatatoXML_Parser class is designed to sit between two fifo's.
  The incomming fifo produces XML data, one file at a time (the 
  class cannot currently handle determining whether more data is
  need to complete the XML file), and encapsulates the data in
  an appropriate RECUV command struct.  This struct is then sent to
  the outgoing fifo.
*/
class MNRSimThread : public ThreadedPipe
{
	private:
		Waypt_t waypoints[NUM_WAYPOINTS];
		int current_waypoint;
		GPSStruct_t gps;
		Velocity_t velocity;
		TimeStamp last_telem_tx;
		void moveMNR();

	public:
		MNRSimThread(String name);
		~MNRSimThread();
		bool init(ShmStruct * shmStructPtr);
		void update();
};

#endif //define
